﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="drugmodify.aspx.cs" Inherits="member_drugmodify" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    </div>
    </form>
</body>
</html>

<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>医药文档云管理平台 - Powered by 成都七彩云和科技有限公司</title>
	<link href="/Public/Home/css/Member.css" rel="stylesheet" type="text/css">
	<script src="/Public/Home/js/jquery1.7.2.js" type="text/javascript"></script>
	<script src="/Public/Home/lhgdialog/lhgdialog.js?skin=discuz" type="text/javascript"></script>
	<!--[if lt IE 9]>
	<script>
	   document.createElement('figure');
	</script>
	<![endif]-->
</head>
<body>
<div class="Member_head">
	<a href="/" class="logo_m" style="margin:6px 0 0 20px;"><img src="/Public/Home_v2/images/logo.png"></a>
            <div style="float: left;margin-top: 25px;margin-left: 100px;color: #fff;font-size: 20px;">还有 72 天到期 ， 到期时间：2018-11-30 00:00:00 </div>
        <ul class="tui fr">
    	<li class="tuiName fl">
            <span>您好，</span>
            <em>欢迎使用医药文档云管理平台</em>
        </li>
        <li class="fl" style="line-height:72px;margin-left:20px;">
                        <a href="/index/index.html" style="color:#fff;">[返回首页]</a>
            <a class="logout" href="/user/logout.html" style="color:#fff;">[退出登录]</a>
        </li>
    </ul>
</div>
<div class="Member_left">
    <h1 class="ml_tit" style="margin-top:72px;">功能</h1>
        <div class="sl erji" style="color:#000">
    	<span class="bg5"></span>
        文档管理
    </div>
    <a href="/member/batch.html" class="ers">检验报告</a>
    <a href="/member/new_batch.html" class="ers">新方式上传检验报告</a>
    <a href="/member/multi.html" class="ers">检验报告批量上传</a>
    <a href="/search/printer.html" target="_blank" class="ers">自动打印</a>
        <hr width="80" style="border:1px dashed #000;margin:0 auto;">
    <a href="/member/instructions.html" class="ers">批件批量上传</a>
    <a href="/member/drug.html" class="ers ersh">批件管理</a>
    <a href="/member/new_drug.html" class="ers">新方式上传批件</a>
        <a href="/member/factoryimg.html" class="ers">厂家证照管理</a>
        <hr width="80" style="border:1px dashed #000;margin:0 auto;">
    <a href="/member/invoice.html" class="ers">供应商发票管理</a>
        <a href="/search/invoiceprinter.html" target="_blank" class="ers">供货商发票自动打印</a>
        <hr width="80" style="border:1px dashed #000;margin:0 auto;">
    <a href="/member/electronic.html" class="ers">电子发票管理</a>
	<a href="/member/customer.html" class="ers">往来单位</a>
	<a href="/member/contract.html" class="ers">合同管理</a>
    
        <a href="/search/printdata.html" class="ers">按年月日打印</a>

    <h1 class="ml_tit">账号设置</h1>
    
        <a href="/member/profiles.html" class="sl">
            <span class="bg1"></span>
            账号设置
        </a>
        <a href="/member/users.html" class="sl">
            <span class="bg1"></span>
            用户管理
        </a>
        <a href="/member/chpwd.html" class="sl">
            <span class="bg2"></span>
            密码修改
        </a>
        <a href="/member/suppliers.html" class="sl">
        <span class="bg3"></span>
        关联企业
    </a>
    <a href="/member/links.html" class="sl">
        <span class="bg3"></span>
        其他公司报告网址
    </a>
</div><style type="text/css">
<!--
.Validform_wrong{color:#F00;}
-->
</style>
<div class="Member_content">
	<form name="modify-form" id="modify-form" action="/member/drug/act/save.html" method="post">
		<input type="hidden" name="_id" value="5ba08d31280f426c6112da71" />
		<h1 class="member_iconTit">
	    	批件管理 > 修改商品	    </h1>
	    <ul class="member_inbig">
	    	<li class="mit">药品ID</li>
	        <li><input type="text" name="drug_id" value="SPH00071435" datatype="*" ajaxurl="/member/drug/act/valid/id/5ba08d31280f426c6112da71.html" placeholder="请输入药品ID" class="min win2" readonly="readonly"></li>
	        <li class="tixin">药品ID不可修改</li>
	    </ul>
	    <ul class="member_inbig">
	    	<li class="mit">药品编号</li>
	        <li><input type="text" name="drug_number" value="71435" datatype="*" ignore="ignore" ajaxurl="/member/drug/act/valid/id/5ba08d31280f426c6112da71.html" placeholder="请输入药品编号" class="min win2"></li>
	        <li class="tixin">请输入药品编号，没有可不填写</li>
	    </ul>
	    <ul class="member_inbig">
	    	<li class="mit">药品名称</li>
	        <li><input type="text" name="drug_name" value="氨茶碱注射液" placeholder="请输入药品名称" datatype="*" nullmsg="请输入药品名称" class="min win_b3"></li>
	        <li class="tixin">请输入药品名称</li>
	    </ul>
	    <ul class="member_inbig">
	    	<li class="mit">药品通用名</li>
	        <li><input type="text" name="drug_usename" value="氨茶碱注射液" placeholder="请输入药品通用名" datatype="*" nullmsg="请输入药品通用名" class="min win_b3"></li>
	        <li class="tixin">请输入药品通用名</li>
	    </ul>
	    <ul class="member_inbig">
	    	<li class="mit">药品规格</li>
	        <li><input type="text" name="drug_rule" value="2ml:0.25g*10支" placeholder="请输入药品规格" datatype="*" nullmsg="请输入药品规格" class="min win2"></li>
	        <li class="tixin">请输入药品规格</li>
	    </ul>
	    <ul class="member_inbig">
	    	<li class="mit">药品单位</li>
	        <li><input type="text" name="drug_point" value="盒" placeholder="请输入药品单位，如盒、瓶、袋等" datatype="*" nullmsg="请输入药品单位，如盒、瓶、袋等" class="min win2"></li>
	        <li class="tixin">请输入药品单位，如盒、瓶、袋等</li>
	    </ul>
	    <ul class="member_inbig">
	    	<li class="mit">国药准字号</li>
	        <li><input type="text" name="drug_zhunzi" value="国药准字H44022007" placeholder="请输入国药准字号"  class="min"></li>
	        <li class="tixin">请输入国药准字号</li>
	    </ul>
	    <ul class="member_inbig">
	    	<li class="mit">生产厂家</li>
	        <li><input type="text" name="drug_changjia" value="" placeholder="请输入药品生产厂家" datatype="*" nullmsg="请输入药品生产厂家" class="min win_b3"></li>
	        <li class="tixin">请输入药品生产厂家</li>
	    </ul>
	    <ul class="member_inbig">
	    	<li class="mit">产地</li>
	        <li><input type="text" name="drug_area" value="" placeholder="请输入药品产地" class="min win2"></li>
	        <li class="tixin">请输入药品产地</li>
	    </ul>
	    <ul class="member_inbig">
	    	<li class="mit">药品注册证</li>
	        <li>
	            <input type="hidden" id="cert_files" name="cert_files" value="">
	        	<input type="button" value="上传" id="upload-scan" class="update updateB1">

	        </li>
	    </ul>
	    <ul class="Upimg" id="Upimg">
	        	    </ul>
	    <h1 class="Mbuto"><a href="javascript:;" id="submit-modify-form" class="queOk">保存</a></h1>
    </form>
</div>
<link href="/Public/Home/webuploader/webuploader.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/Public/Home/js/Validform_v5.3.2_min.js"></script>
<script type="text/javascript" src="/Public/Home/webuploader/webuploader.withoutimage.min.js"></script>
<script type="text/javascript">
    function callbackfun(data) {
        $.dialog.tips('上传成功', 1, 'success.gif');
        var files = $('#cert_files').val();
        var value = data.join(',');
        if (files.length > 0) {
            value = value + ',' + files;
        }
        $.each(data, function () {
            $('#Upimg').append('<li><span><img src="' + this + '"></span><em><img src="/Public/Home/images/close.png"></em></li>');
        });
        $('#cert_files').val(value);

    }
    $(function () {
        $('#modify-form').Validform({
            tiptype: function (msg, o, cssctl) {
                if (!o.obj.is("form")) {
                    var objtip = o.obj.closest("ul.member_inbig").find('li.tixin');
                    cssctl(objtip, o.type);
                    objtip.text(msg);
                }
            },
            btnSubmit: "#submit-modify-form",
            showAllError: true,
            ajaxPost: true,
            beforeSubmit: function (curform) {
                $('#submit-modify-form').text('保存中...');
                $.dialog.tips('数据提交中,请稍等...', 1000, 'loading.gif');
            },
            callback: function (data) {
                $.dialog.tips(data.msg ? data.msg : '抱歉，系统错误，请稍后再试！', 2, data.code == 1 ? 'success.gif' : 'error.gif', function () {
                    window.location.reload();
                });
                return false;
            }
        });

        /*文件上传开始*/
        var uploader = WebUploader.create({
            swf: '/Public/Home/webuploader/Uploader.swf',
            server: '/base/uploader/type/drug.html',
            pick: '#upload-file',
            auto: true,
            width: 100,
            height: 40,
            accept: {
                title: '图片/pdf文件',
                extensions: 'gif,jpg,jpeg,bmp,png,pdf',
                mimeTypes: 'image/*,application/pdf'
            },
            resize: false,
            compress: {
                width: 2480,
                height: 3415,
                quality: 10,// 图片质量，只有type为`image/jpeg`的时候才有效。
                allowMagnify: false,// 是否允许放大，如果想要生成小图的时候不失真，此选项应该设置为false.                   
                crop: false,// 是否允许裁剪。
                preserveHeaders: true,// 是否保留头部meta信息。
                // 如果发现压缩后文件大小比原来还大，则使用原来图片
                // 此属性可能会影响图片自动纠正功能
                noCompressIfLarger: false,
                // 单位字节，如果图片大小小于此值，不会采用压缩。
                compressSize: 2 * 1024 * 1024
            },
            fileNumLimit: 5,
            fileSizeLimit: 50 * 1024 * 1024,    //50 M
            fileSingleSizeLimit: 10 * 1024 * 1024    //10 M
        });
        uploader.on('uploadSuccess', function (file, response) {
            if (response.code == 1) {
                callbackfun(response.data);
            } else {
                $.dialog.tips(response.msg, 2, 'error.gif');
            }
        });
        uploader.on('error', function (code) {
            if (code == 'Q_EXCEED_NUM_LIMIT') {
                $.dialog.tips('一次上传不得超过5张图片', 2, 'error.gif');
            } else if (code == 'F_EXCEED_SIZE' || code == 'Q_EXCEED_SIZE_LIMIT') {
                $.dialog.tips('上传的图片不能超过10M', 2, 'error.gif');
            } else {
                $.dialog.tips('Eroor: ' + code, 2, 'error.gif');
            }
        });
        uploader.on('startUpload', function (file, response) {
            $.dialog.tips('文件上传中...', 1000, 'loading.gif');
        });

        /*扫描仪上传开始*/
        $('#upload-scan').on('click', function () {
            $.dialog({
                title: "药品注册证扫描",
                width: 965,
                height: 533,
                content: 'url:/uploader/dynamsoftcs/type/drug.html',
                padding: 0,
                lock: true,
                min: false,
                max: false,
                close: function () {
                    if (this.iframe.contentWindow.dcsObject) {
                        this.iframe.contentWindow.dcsObject.destroy();
                    }
                }
            });
            return false;
        });


        /*拍照上传开始*/
        $('#upload-camera').on('click', function () {
            var url;
            var width = 1000;
            if ($.browser.msie) {
                url = '/base/camera/type/drug.html';
            } else {
                width = 730;
                url = '/base/webrtc/type/drug.html';
            }
            $.dialog({
                title: "药品注册证拍照",
                width: width,
                height: 546,
                content: 'url:' + url,
                padding: 0,
                lock: true,
                min: false,
                max: false
            });
            return false;
        });

        $('#Upimg').on('click', 'em', function () {
            var file = $(this).closest('li').find('span img').attr('src');
            var files = $('#cert_files').val();
            var arrList = files.split(",");
            arrList.splice(jQuery.inArray(file, arrList), 1);
            $('#cert_files').val(arrList.join(','));
            $(this).closest('li').remove();
            return false;
        });
    });
</script>
<script type="text/javascript">
    $(document).ready(window.onresize = function () {
        //var whe = $(window).height();
        //$(".Member_left").css("height",whe-72);
        $('body').on('click', '.ajax-url', function () {
            var msg = '确定要执行该操作吗？';
            var url = $(this).attr('href');
            if ($(this).attr('data-msg')) {
                msg = $(this).attr('data-msg');
            }
            $.dialog.confirm(msg, function () {
                $.ajax({
                    url: url,
                    type: "post",
                    data: {},
                    dataType: 'json',
                    success: function (data) {
                        if (data.code == 1) {
                            $.dialog.tips(data.msg ? data.msg : '操作成功', 2, 'success.gif', function () {
                                window.location.reload();
                            });
                        } else {
                            $.dialog.tips(data.msg ? data.msg : '抱歉，系统错误，请稍后再试！', 2, 'error.gif');
                        }
                    },
                    error: function () {
                        $.dialog.tips('抱歉，系统错误，请稍后再试！', 2, 'error.gif');
                    }
                });
            });
            return false;
        });
        $('.logout').on('click', function () {
            var href = $(this).attr('href');
            $.dialog.confirm('您确定要退出登录吗？', function () {
                window.location.href = href;
            });
            return false;
        });
        if (!('placeholder' in document.createElement('input'))) {
            $('input[placeholder],textarea[placeholder]').each(function () {
                var that = $(this),
                text = that.attr('placeholder');
                if (that.val() === "") {
                    that.val(text).addClass('placeholder');
                }
                that.focus(function () {
                    if (that.val() === text) {
                        that.val("").removeClass('placeholder');
                    }
                })
                .blur(function () {
                    if (that.val() === "") {
                        that.val(text).addClass('placeholder');
                    }
                })
                .closest('form').submit(function () {
                    if (that.val() === text) {
                        that.val('');
                    }
                });
            });
        }
    });
</script>
</body>
</html>
